package com.training.java.core.collections.post15;

public class School {

	private String name;
	private String city;
	private String schoolDistrict;
	private int greatSchoolRanking;

	School(String name, String city, String schoolDistrict,
			int greatSchoolRanking) {
		this.name = name;
		this.city = city;
		this.schoolDistrict = schoolDistrict;
		this.greatSchoolRanking = greatSchoolRanking;
	}

	public String getName() {
		return name;
	}

	public String getCity() {
		return city;
	}

	public String getSchoolDistrict() {
		return schoolDistrict;
	}

	public int getGreatSchoolRanking() {
		return greatSchoolRanking;
	}

	@Override
	public boolean equals(Object obj) {
		School that = (School) obj;

		if (this.name.equals(that.name) && this.city.equals(that.city)
				&& this.schoolDistrict.equals(that.schoolDistrict)) {
			return true;
		} else {

			return false;
		}
	}

	@Override
	public int hashCode() {

		return name.hashCode() + city.hashCode() + schoolDistrict.hashCode();
	}

}
